﻿using System;
using System.Web.Mvc;

namespace Sencha.Direct.Api
{
	public class ParameterDescription
	{
		private ParameterDescriptor m_descriptor;

		public ParameterDescriptor Descriptor { get { return m_descriptor; } }
		public string Name { get; private set; }
		public Type Type { get; private set; }

		public object DefaultValue { get; private set; }

		public ParameterDescription(ParameterDescriptor parameterDescriptor)
		{
			if (parameterDescriptor == null)
				throw new ArgumentNullException("parameterDescriptor");
			m_descriptor = parameterDescriptor;

			this.Name = parameterDescriptor.ParameterName;
			this.Type = parameterDescriptor.ParameterType;
			this.DefaultValue = parameterDescriptor.DefaultValue;
		}

		public override string ToString()
		{
			return string.Format("{0} {1}", this.Type, this.Name);
		}

	}
}
